package com.hxx.controller;

import com.hxx.ai.StreamingChatAisistant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
public class StreamingAiController {
    @Autowired
    private StreamingChatAisistant streamingChatAisistant;

    @GetMapping("/streaming")
    public Flux<String> streaming(String prompt) {
        return streamingChatAisistant.chat(prompt);
    }
}





































